/**
 * 
 */
package ltu.m7011e.server.webservice;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

import ltu.m7011e.server.response.GlobalResponse;
import ltu.m7011e.server.response.LinkPost;



/**
 * API to interact with the link service
 * @author robinelmouahidine
 *
 */
@Path("/link")
public interface ILinkWebService { // extends RestService {
	
	/**
	 * 
	 * @return
	 */
	@GET
	@Path("/getNewestLinks")
	@Produces("application/XML")
	public GlobalResponse GetNewestLinks(@QueryParam("numberOfRecords") int numberOfRecords,@QueryParam("firstResult") int firstResult);
	
	/**
	 * 
	 * @return
	 */
	@GET
	@Path("/getTopLinks")
	@Produces("application/XML")
	public GlobalResponse GetTopLinks(@QueryParam("numberOfRecords") int numberOfRecords,@QueryParam("firstResult") int firstResult);
	/**
	 * 
	 * @return
	 */
	@POST
	@Path("/loadLogin")
	@Produces("application/XML")
	public GlobalResponse loadLogin();
	
	@POST
	@Path("/getLink")
	@Produces("application/XML")
	public GlobalResponse GetLink(@QueryParam("numberOfRecords") int numberOfRecords,@QueryParam("firstResult") int firstResult,@QueryParam("category") String cat);
	
	/**
	 * 
	 * @param newLink
	 * @return
	 */
	@POST
	@Path("/postLink")
	@Consumes({MediaType.APPLICATION_XML, MediaType.TEXT_XML})
	public Response PostLink(LinkPost newLink);
	
	/**
	 * 
	 * @param linkId
	 * @return
	 */
	@GET
	@Path("/likeLink")
	public Response SendLikeToServer(@QueryParam("linkId") Integer linkId);

}
